
#pragma once
#include <string>
#include <vector>
#include <map>
#include "fs/path.h"

struct Params {

	fs::Path configfile;
	fs::Path mimefile;
	std::string host;
	unsigned short port;
	fs::Path root;
	fs::Path index;
	bool autoindex;
	bool nocache;
	bool hideme;

	Params();
};

class MimeTypes {
public:
	MimeTypes( const std::string & default_mime = "plain/text" );
	const std::string operator[]( const std::string & ext ) const;
	void update( const std::string & ext, const std::string & mime );
	void clear();
	void erase( const std::string & ext );
private:
	// types.
	typedef std::map<std::string, std::string> BaseContainer;

	// members.
	std::string default_mime() const;

	// members.
	BaseContainer _base;
	std::string _default_mime;
};